package gui;

/**
 * @author Ramy Refky 
 * */
public class TextComponentGraphics extends ComponentGraphics{

	private static final long serialVersionUID = 1L;
	
	/**
	 * Constructor initializes Text Component by initializing ComponentGraphics with no ComponentPins.
	 * @param MainGui, XLocation, YLocation, Width, Height , Text
	 * */
	public TextComponentGraphics(MainGui mg,int originalXLoc,int originalYLoc,
			int originalWidth,int originalHeight,String text){
		super(mg,originalXLoc,originalYLoc,originalWidth,originalHeight,0,0);
		
		this.remove(compLabel);
		compLabel=new TextComponentLabel(newXLoc,newYLoc,originalWidth,originalHeight);
		((TextComponentLabel) compLabel).setComponentText(text);
		this.add(compLabel);
		setComponentZOrder(compLabel,0);
		repaint();
	}
	/**
	 * Gets the title of the TEXT component.
	 * @return String
	 * */
	public String getComponentText(){
		return ((TextComponentLabel) compLabel).getComponentText();
	}
}